BUILD_CMD := wails build

ifeq ($(OS),Windows_NT)
    OS := windows
	# using msys2 mingw64 tools
	MKDIR := mkdir -p
    RMDIR := rm -rf
    RM := rm -f
	CP := cp -f
	CPDIR := cp -rf
	# MKDIR := powershell -Command "New-Item -ItemType Directory -Force"
    # RMDIR := powershell -Command "Remove-Item -Recurse -Force"
    # RM := powershell -Command "Remove-Item -Recurse -Force"
	# CP := powershell -Command "Copy-Item  -Recurse -Force"
	# CPDIR := powershell -Command "Copy-Item  -Recurse -Force"
else
	OS := $(shell uname -s)
	MKDIR := mkdir -p
    RMDIR := rm -rf
    RM := rm -f
	CP := cp -f
	CPDIR := cp -rf
endif

# 编译输出目录
BUILD_DIR := build/bin


build: clean
	$(BUILD_CMD)
	$(CPDIR) template $(BUILD_DIR)/template

# 清理命令
clean:
	$(RMDIR) $(BUILD_DIR)/fpga_vboard*
	$(RMDIR) $(BUILD_DIR)/template

# 默认执行命令
.DEFAULT_GOAL := build

.PHONY: build clean